<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>六西格玛知识管理</title>
<link href="<?php echo $this->baseUrl ?>/public/style/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/form-check.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/daterangepicker.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/thickbox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jquery.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/daterangepicker.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jquery-ui.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/thickbox-compressed.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jQuery.FormValidator.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/fckeditor/fckeditor.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jQuery.FormValidator.js"></script>
</head>

<body>
<!--头部-->
<?php echo $this->partial('common/header.html', array('template'=>$this->template, 'baseUrl'=>$this->baseUrl)) ?>

<!--主体-->
<div class="main-box" id="mainBox">
	<div class="third-menu">
		<?php echo $this->partial('common/operation.html', array('template'=>$this->template, 'baseUrl'=>$this->baseUrl, 'id'=>$_GET['course_id'])) ?>
		<div class="menu-title"><span class="icon"></span>参考案例</div>
	</div>
	<div class="separate-line"></div>
  
	<div class="main-form">
	<form name="form1" method="post" action="<?php echo $this->baseUrl ?>/course/caseadd?course_id=<?php echo $_GET['course_id'] ?>">
		<input type="hidden" name="course_id" value="<?php echo $_GET['course_id']; ?>" />
		<p>
        	<label for="title">课程名称：</label><?php echo $this->course[0]['name']; ?>
        </p>
  		<p>
    		<label>参考案例：</label>
        	<a href="<?php echo $this->baseUrl ?>/project/add" class="color-button button" style="margin-left:0">添加项目</a>
        	<a href="<?php echo $this->baseUrl ?>/project/hover?keepThis=true&TB_iframe=true&height=360&width=330" class="button thickbox">选择案例</a> 
		</p>
        <div id="add_case">
        </div>
        <?php if($this->project_cases): ?>
        <?php foreach ($this->project_cases as $key => $val): ?>
		<p>
			<label><?php if($key==0): ?>现有案例：<?php else: ?>&nbsp;<?php endif; ?></label>
			<a href=""><?php echo $val['title']; ?></a><span style="padding-left:10px;"><a href="<?php echo $this->baseUrl ?>/course/deleteproject?course_id=<?php echo $_GET['course_id']; ?>&project_id=<?php echo $val['project_id']; ?>">删除</a></span>
		</p>
        <?php endforeach; ?>
        <?php endif; ?>
		<p><label>&nbsp;</label><input type="submit" class="button" value="提 交" style="margin-left:0" /></p>
	</form>
	</div>
</div>

<div id="hiddenModalContent" style="display:none">
<div class="mod-popSelect" style="width:350px; margin:auto;">
    <div class="select-list">
    	<ul>
        	<?php foreach ($this->projects as $key => $val): ?>
        	<li <?php if ($key%2 == 1): ?>class="gray"<?php endif; ?>><input type="checkbox" name="case[]" class="case_checkbox" /><label class="case_label"><?php echo $val['title']; ?></label><span style="display:none" class="case_span"><?php echo $val['project_id']; ?></span></li>
            <?php endforeach; ?>
        </ul>
    </div>
    <div class="select-submit"><input type="button" class="select-btn" value="确认选择" id="choose_case" /></div>
</div>
</div>
<script>
$(document).ready(function(){
	$("#choose_case").click(function(){
		$("#add_case").empty();
		var insert_message = '';
		$(".case_checkbox:checked").each(function(){
			var project_title = $(this).siblings("label").text();
			var project_id = $(this).siblings("span").text();
			insert_message += "<p><label>新增案例：</label><a href='<?php echo $this->baseUrl ?>/project/detail?project_id="+project_id+"' target='_blank'>"+project_title+"</a><input type='hidden' name='case_id[]' value='"+project_id+"' /></p>";
		});
		$("#add_case").append(insert_message);
		$("#TB_window").css('display','none');
		$("#TB_overlay").remove();
	});
});
</script>










<!--底部-->
<?php echo $this->partial('common/footer.html') ?>
</body>
</html>